from django.contrib import admin

# Register your models here.

from goods import models


@admin.register(models.GoodsGroup)
class GoodsGroupAdmin(admin.ModelAdmin):
    list_display = ['name', 'status']  # 要显示的字段


# 注册模型类
# admin.site.registe(models.GoodsGroup, GoodsGroupAdmin)


@admin.register(models.Goods)
class GoodsAdmin(admin.ModelAdmin):
    list_display = ['title', 'group', 'price', 'stock', 'sales', 'is_on']  # 要显示的字段


@admin.register(models.Detail)
class DetailAdmin(admin.ModelAdmin):
    list_display = ['goods', 'producer', 'norms']  # 要显示的字段


@admin.register(models.GoodsBanner)
class GoodsBannerAdmin(admin.ModelAdmin):
    list_display = ['title', 'status']  # 要显示的字段


@admin.register(models.Collect)
class CollectAdmin(admin.ModelAdmin):
    list_display = ['user', 'goods']  # 要显示的字段
